

#ifndef PERMISSIONS_PRESERVER_H_INCLUDED
#define PERMISSIONS_PRESERVER_H_INCLUDED

#include <wx/wxprec.h>

#ifndef WX_PRECOMP
    #include <wx/wx.h>
#endif

#include <cbplugin.h> 
#include <sys/stat.h>


class PermissionsPreserver : public cbPlugin
{
    public:
        
        PermissionsPreserver();
        
        virtual ~PermissionsPreserver();


        
        virtual void BuildMenu(wxMenuBar* menuBar){}

        
        virtual void BuildModuleMenu(const ModuleType type, wxMenu* menu, const FileTreeData* data = 0){}

        
        virtual bool BuildToolBar(wxToolBar* toolBar){ return false; }
    protected:
        
        virtual void OnAttach();

        
        virtual void OnRelease(bool appShutDown);
    private:
        void OnEditorBeforeSave(CodeBlocksEvent& event);
        void OnEditorSave(CodeBlocksEvent& event);
        wxString m_filename;
        mode_t m_permissions;

};

#endif // PERMISSIONS_PRESERVER_H_INCLUDED
